package person.bing.fbcloud.common.core.xss.filter;

import person.bing.fbcloud.common.core.xss.wrappers.XssHttpServletRequestWrapper;

import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * @author: mengfanbing
 * @date: 2019/9/18
 */
public class XssFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        HttpServletRequest httpServletRequest = (HttpServletRequest)request;
        System.out.println("我是{孟凡兵}的过滤器");
        chain.doFilter(new XssHttpServletRequestWrapper(httpServletRequest),response);
    }

    @Override
    public void destroy() {
    }
}
